<template>
  <div>
    <MyHeader :title="str" :background="bgc" :color="color"></MyHeader>
    <div class="main">
      <MyGoods :gObj="item" v-for="item in list" :key="item.id"></MyGoods>
    </div>
    <MyFooter :list="list"></MyFooter>
  </div>
</template>

<script>
import MyHeader from './components/MyHeader'
import MyGoods from './components/MyGoods'
import MyFooter from './components/MyFooter'
export default {
  components: {
    MyHeader,
    MyGoods,
    MyFooter
  },
  data() {
    return {
      str: '一个有自己想法的购物车',
      bgc: 'skyblue',
      color: 'deeppink',
      list: []
    }
  },
  created() {
    this.$axios({
      url: '/api/cart',
      mehtod: 'GET',
    }).then(res => {
      console.log(res);
      this.list = res.data.list})
  },
}
</script>

<style>
.main {
  padding-top: 45px;
  padding-bottom: 50px;
}
</style>